<?php
namespace app\admin\controller;
use app\admin\controller\Common;

use think\Db;
class Camera extends Common{
    public function cameraList(){
        $parkingNo = $this->getParkingNo();
        $page = request()->has('page') ? request()->get('page') : 1;
        $where=array();
        $list = Db::name('parking_camera')->where('parkingNo','in',$parkingNo)->where($where)->order('id desc')->paginate(100, false, [
            'page'  =>  $page,
            'query' =>  $where
        ]);
        $number =  Db::name('parking_camera')->where('parkingNo','in',$parkingNo)->where($where)->count();
        $this->assign("list",$list);
        $this->assign("number",$number);
        return $this->fetch("camera_list");
    }
    public function cameraAdd(){
       if(request()->isPost()){
           
       }else{
           $client_id=request()->get("id");
           $clientinfo=Db::table("parking_client")->where("id",$client_id)->find();
           $this->assign("clientinfo",$clientinfo);
           return $this->fetch("admin@camera/camera_add");
       }
    }
    
	

}